import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/emsapi/blade-ems/userworkgroup/page',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/emsapi/blade-ems/userworkgroup/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/emsapi/blade-ems/userworkgroup/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const removeByUserID = (obj) => {
  return request({
    url: "/emsapi/blade-ems/userworkgroup/removeByUserID",
    method: "post",
    params: {
      userId: obj.userId,
      workUid: obj.workUid,
    },
  });
};

export const removeByWorkID = (workid) => {
  return request({
    url: "/emsapi/blade-ems/userworkgroup/removeByWorkID",
    method: "post",
    params: {
      workUid: workid,
    },
  });
};



export const add = (row) => {
  return request({
    url: '/emsapi/blade-ems/userworkgroup/submit',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/emsapi/blade-ems/userworkgroup/submit',
    method: 'post',
    data: row
  })
}

